//************************************************************************************
// 	 This software simulated ARPEES protocol for Wireless Sensor Network             *
//	 Copyright (C) 2007 by Tran Quang Vinh (vinhtq@mail.hut.edu.vn)                  *
//	 Multimedia Information NETwork Lab - MINET                                      *
//	 Dept. Electronic Information Systems, Graduate School of Enginnering            *
//	 Shibaura Institute of Technology, Japan.                                        *
//-----------------------------------------------------------------------------------*
//	 File name: MessageType.msg				                                         *
//	 the method of OMNET++ to implement the messages in the protocal                 *
//***********************************************************************************/


// Base class for message types
message ClusterMessage
{
    int proto;
    int srcAddress;
    int destAddress;
}

//***********************************************************************************/
// Status sent from Node to BS
message Status2BSMessage extends ClusterMessage
{
    int energy;
    int status;
    int cluster;
    int xpos;
    int ypos;
}

//***********************************************************************************/
// BS sends this message to anounce cluster heads to nodes
message ClusterHeadMessage extends ClusterMessage
{
    int cHead[];
}

//***********************************************************************************/
// TDMA message
message TDMAMessage extends ClusterMessage
{
    int frames;
    int frameTime;
    int tdma[];      //  constant
    int timeSlot;
    int clusterMember;

}

//***********************************************************************************/
// Data sent by nodes to cluster heads
message DataToCHMessage extends ClusterMessage
{
    int cluaterHead;
    int data;
}

//***********************************************************************************/
// Data sent by nodes to BS
message Data2BSMessage extends ClusterMessage
{
    int data;
}

//***********************************************************************************/
// Message sent from Event to node
message Event2NodeMessage extends ClusterMessage
{
    int metadata;

}

//***********************************************************************************/
// Message sent from CH to Relay node
message RequestRNMessage extends ClusterMessage
{
    int energy;
    int status;
    int xpos;
    int ypos;
}

//***********************************************************************************/
// Data sent by nodes to RN
message Data2RNMessage extends ClusterMessage
{
    int data;
    int relayNode;
    string displayString = "i=msg/mail_vs";
}

//***********************************************************************************/
message RequestRelayNodeMessage extends ClusterMessage {
    
}

message RequestRN extends ClusterMessage {
    int flag;
    
}    
message AckRelayNodeMessage extends ClusterMessage {
    double value;
    double valueCmp;
}
message AckRN extends ClusterMessage {
    double value;
    double valueCmp;
}   
message StatusInfo extends ClusterMessage
{		
    int idCH;
    double energy;
    //string displayString="i=,kind,100%";
}
message ClusterHeadAdv extends ClusterMessage {
   
}    
message CHJoin extends ClusterMessage {
     int status;
}    


